@extends('backend::layout')
@section('title',trans($page_title))
@section('content')
    <div class="row"><div class="col-sm-12 mb-2">
            @component('backend::component.form.button')
                @slot('title') 修改信息 @endslot
                @slot('elem') a @endslot
                @slot('btn') btn @endslot
                @slot('color') primary @endslot
                @slot('icon') hcl-edit @endslot
                @slot('href') {{route('b_ShopGoods_update',['id'=>$info->goods_id])}} @endslot
            @endcomponent
        </div></div>
    <div class="row"><div class="col-sm-12">
            @if($info)
                <table class="table table-bordered info-card">
                    <tbody>
                    <tr><td rowspan="4" style="min-width: 225px;width: 225px">
                            <div class="d-flex flex-column  text-center m-3" >
                                <img src="{{str2arr($info->goods_images)[0]}}" style="width: 200px;" class="rounded">
                                <span class="text-muted mt-2">货号:{{$info->goods_code}}</span>
                            </div>
                        </td>
                        <td class="table-active">商品名称</td><td>{{$info->goods_name}}</td>
                        <td class="table-active">所属分类</td>
                        <td colspan="3">
                            @foreach($category as $title)
                                {{$title}} @if(!$loop->last) > @endif
                            @endforeach
                        </td>
                    </tr>
                    <tr><td class="table-active">关键词</td>
                        <td>{{$info->keywords}}</td>
                        <td class="table-active">描述</td>
                        <td colspan="3">{{$info->description}}</td>
                    </tr>
                    <tr>
                        <td class="table-active">零售价</td>
                        <td>{{$info->price}}</td>
                        <td class="table-active">市场价</td>
                        <td>{{$info->market_price}}</td>
{{--                        <td class="table-active">会员价</td>--}}
{{--                        <td>{{$info->vip_price}}</td>--}}
                    </tr>
                    <tr><td class="table-active">图集</td><td colspan="5">
                            @foreach(str2arr($info->goods_images) as $src)
                                <img src="{{$src}}" style="width: 80px;" class="rounded">
                            @endforeach
                        </td>
                    </tr>
                    </tbody>
                </table>
                <div class="card">
                    <div class="card-body">
                        @if($info->specs->isNotEmpty())
                        <h4 class="mb-2 mt-5 text-dark" style="font-size: 1.05rem;">
                            <i class="hcl hcl-sq mr-1" style="font-size: 1.05rem;"></i>货品信息
                        </h4>
                        <table class="table table-bordered table-striped tbody info-card">
                            <tbody>
                                <tr>
                                    <td style="width: 140px;">SKU编号</td>
                                    @foreach($info->specs as $item)
                                        <td>{{$item->title}}</td>
                                    @endforeach
                                    <td>零售价</td>   <td>市场价</td>   <td>会员价</td><td>库存</td></tr>
                                @foreach($info->sku as $value)
                                <tr><td>{{$value->sku_sn}}</td>
                                    @foreach(str2arr($value->goods_spec_items) as $val)
                                        <td>{{$val}}</td>
                                    @endforeach
                                    <td>{{$value->price}}</td><td>{{$value->market_price}}</td><td>{{$value->vip_price}}</td><td>{{$value->stock}}</td>
                                </tr>
                                @endforeach
                            </tbody>
                        </table>
                        @endif
                        <h4 class="mb-2 mt-5 text-dark" style="font-size: 1.05rem;">
                            <i class="hcl hcl-sq mr-1" style="font-size: 1.05rem;"></i>商品详情
                        </h4>
                        <div>
                            {!! $info->wp_detail !!}
                        </div>
                    </div>
                </div>
            @else
                @component('backend::public.empty_page')
                    @slot('info')查询不到该商品 @endslot
                @endcomponent
            @endif
        </div></div>
@endsection